import request from '@/utils/request'

// 获取询价列表
export function findListByCustomerId (data) {
  return request({
    url: '/bidEvent/findListByCustomerId',
    method: 'post',
    data: data
  })
}

// 申请退款
export function refund (data) {
  return request({
    url: '/shareBill/refund',
    method: 'post',
    data: data
  })
}

// 询价事件转成拼单事件
export function editBidCarAndShareBill (data) {
  return request({
    url: '/bidEvent/editBidCarAndShareBill',
    method: 'post',
    data: data
  })
}

// 查询拼单列表
export function findByCustomerId (customerId) {
  return request({
    url: '/shareBill/findByCustomerId',
    method: 'post',
    data: {
      customerId: customerId
    }
  })
}

// 根据用户id 查询拼单列表(分页)
export function findByCustomerIdShareBills (data) {
  return request({
    url: 'shareBill/findByCustomerIdShareBills',
    method: 'post',
    data: data
  })
}

// 根据用户id 获取订单信息 （分页）
export function getOrderList (data) {
  return request({
    url: '/findByCustomerId',
    method: 'post',
    data: data
  })
}

// 根据carId获取商品价格详情
export function getGoodsFindByCarId (data) {
  return request({
    url: '/goods/findByCarId',
    method: 'post',
    data
  })
}

// 根据orderId来获取用户行为信息
export function getCustomerOrderAction (data) {
  return request({
    url: '/customer/findByOrderId',
    method: 'post',
    data
  })
}

// 根据orderId获取订单详情,订单使用
export function getCustomerOrderInfo (data) {
  return request({
    url: '/findByOrderId',
    method: 'post',
    data
  })
}

// 根据orderId获取询价单详情
export function getBidOrderInfo (data) {
  return request({
    url: '/bidEvent/findByOrderId',
    method: 'post',
    data
  })
}

// 根据carId获取最低价格列表
export function findPriceListByCarId (data) {
  return request({
    url: '/goods/findPriceListByCarId',
    method: 'post',
    data: data
  })
}

// 检验二维码是否过期
export function checkQRcode (data) {
  return request({
    url: '/checkQRcode',
    method: 'post',
    data: data
  })
}

// 根据拼单Id移除拼单
export function removeShareBill (data) {
  return request({
    url: '/shareBill/removeShareBill',
    method: 'post',
    data: data
  })
}

// 根据orderId 获取拼单信息
export function findByOrderIdShareBille (data) {
  return request({
    url: '/shareBill/findByOrderIdShareBille',
    method: 'post',
    data: data
  })
}

// 根据id修改拼单信息
export function updateShareBillById (data) {
  return request({
    url: '/shareBill/updateShareBillById',
    method: 'post',
    data: data
  })
}

// 退款原因接口
export function saveRefundReason (data) {
  return request({
    url: '/refundReason/saveRefundReason',
    method: 'post',
    data: data
  })
}
